package br.com.uzinadosoftware.main;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;

public class TelaPrincipal extends Activity {
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        String[] lista = {"PIZZARIA DO GORDO (Marcilio)", "Atlantico","Sabor Antigo", "Novo Sabor"};
        Button botaoCadastro = (Button)findViewById(R.id.buttonCadastrar);
        
        final TextView textUsuario = (TextView)findViewById(R.id.editTextUsuario);
        final TextView textSenha = (TextView)findViewById(R.id.editTextSenha);
        final Spinner combo = (Spinner) findViewById(R.id.spinnerRestaurante);
        
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,lista);
        adapter.setDropDownViewResource(android.R.layout.simple_list_item_1);
        combo.setAdapter(adapter);
        botaoCadastro.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Log.w("APERTOU", "apertou");
				Log.i("USUARIO", textUsuario.getText().toString());
				Log.i("USUARIO", textSenha.getText().toString());
				Log.i("ITEM SELECIONADO",combo.getSelectedItem().toString());
			}
			
		});
        
    }    
    
    
}